System and method for managing a list of entries containing routing information

ABSTRACT

A system and method adds and manages entries on a list of entries of routing information to allow the top entry to be used for routing to a destination corresponding to the list. Costs of a wireless link may be a function of the success rate experienced on that wireless link.

RELATED APPLICATIONS

This application is a continuation of U.S. Ser. No. 13/334,188 filedDec. 22, 2011, which is a continuation of U.S. Ser. No. 12/290,843, nowU.S. Pat. No. 8,085,768, filed Nov. 3, 2008, which claims the benefit ofU.S. Provisional Patent Application Ser. No. 61/001,520, entitled“Method and Apparatus for Managing Entries on a List of RoutingInformation” filed by Jonathan Hui, Alec Woo and David Culler on Nov. 1,2007, and is related to the subject matter of U.S. Provisional PatentApplication Ser. No. 61/001,634 entitled, “Method and Apparatus forProviding Route Information” filed on Nov. 1, 2007 by Jonathan Hui, AlecWoo and David Culler, U.S. application Ser. No. 12/290,850 entitled“System and Method for Providing Route Information”, filed concurrentlyherewith by Jonathan Hui, Alec Woo and David Culler, U.S. patentapplication Ser. No. 12/290,848 entitled, “System and Method forAccepting Information From Routing Messages Into A List” filedconcurrently herewith by Jonathan Hui, Alec Woo and David Culler, U.S.patent application Ser. No. 12/290,822 entitled, “System and Method forComputing Cost Metrics for Wireless Network Links” filed concurrentlyherewith by Jonathan Hui, Alec Woo and David Culler, each having thesame assignee as this application and each is incorporated herein byreference.

FIELD OF THE INVENTION

The present invention is related to computer software and morespecifically to computer software for computer networking.

BACKGROUND OF THE INVENTION

Routing messages are messages that are sent from one node that routesmessages in a network, to one or more other nodes that route messages inthe network, to inform the one or more other nodes receiving the messageof the routing costs of the sender. The receiving nodes then use theinformation contained in the routing messages they receive to identifythe path or paths by which messages should be sent, and to build andsend their own routing messages using the path or paths identified.

Paths may be identified by selecting a path with the lowest cost to thedestination. Conventional costs may include hop counts, i.e. the numberof nodes between a node attempting to send a message that is to berouted, and the destination specified or implied by the message. Becausethe speed at which a message may be sent can be dramatically impacted bythe hop count of a wired network, selecting a path with the lowest hopcount or other low costs can allow messages to be routed as rapidly, ornearly rapidly as possible. However, conventional hop counts may notaccurately address all of the issues associated with sending a messagein a wireless network.

When routing messages, routing loops may occur, whereby a first noderoutes to another node that routes through the first node. It isdesirable to avoid routing messages through such routing loops.

What is needed is a system and method that can efficiently routemessages while addressing the needs of a wireless network, yet be ableto accommodate frequent changes and to avoid routing loops.

SUMMARY OF INVENTION

A system and method receives routing messages and determines if thereceived routing message will cause, or has an identified potential tocause, a routing loop. A routing loop occurs when a first node routes amessage to a second node that routes back through the first node to thedestination. The first N nodes through which a node will route and/orthe hop count are included in each routing message to allow fordetection of a routing loop. An identified potential to cause a routingloop may correspond to a message that includes the identifier of thereceiving node in the list of the first N nodes, or has a higher hopcount of routing to the destination than that corresponding to the nodereceiving the message. A message that does not have a routing loop, orhave an identified potential to cause a routing loop, is considered forstorage.

Such a message is stored if space is available. If space is unavailable,the system and method compares the advertised cost of the receivedrouting message with a cost associated with an entry stored at the endof a candidate next hop list of semi-sorted routing informationdescribed in more detail below. If the cost of the received routingmessage is much higher than the entry, the received routing message isdiscarded. If the cost of the received routing message is much lowerthan the entry, the system and method replaces the entry withinformation from the received routing message. If the cost described inthe received routing message is near the cost associated with the entry,the system and method compares one or more measures of signal quality,such as RSSI (a measure of signal strength), bit error rates, chip errorrates, or all of these, of the received routing message with that of amessage to which the information corresponding to the last entry in thecandidate next hop list corresponds. If the received routing message hasa much higher signal quality than that associated with the entry, thesystem and method replaces the entry with information from the receivedrouting message and its signal quality, and otherwise, the system andmethod discards the received routing message. In one embodiment, if thelink cost for the bottom entry in the candidate next hop list has notbeen evaluated as described below, the received beacon will not be usedto replace it, or will not be used to replace it unless the advertisedcost in the received beacon is much lower than the advertised cost ofthe bottom entry in the candidate next hop list.

As communications are received to be routed to a destination, thecandidate next hop list is used to select a node through which to routeeach communication. The node corresponding to the top entry in thecandidate next hop list (i.e. the head) is generally used to routecommunications to a gateway or other destination. If that node isunavailable, an entry is randomly selected from among those on thecandidate next hop list having a hop count not greater or notsignificantly greater than the hop count of the node at the head of thecandidate next hop list (with preference given to those not alreadyselected once) and one or more attempts are made to send thecommunication to the node corresponding to the randomly selected entry.If an acknowledgement is received, the number of attempts it took tosuccessfully send the message is identified as a link cost to that node,and that link cost may be combined with any other link cost previouslyidentified for the node to compute the link cost for the node that isstored with the entry on the candidate next hop list.

The total cost, including the link cost to the node and the cost thenode itself advertised in the last routing message the node sent, isthen compared with the entries in the candidate next hop list above andbelow the selected entry. If the cost identified is lower than the totalcost of the entry above it, and the link cost does not exceed athreshold maximum cost, the entry is moved up one position on thecandidate next hop list. Otherwise, if the cost identified is higherthan the total cost of the entry below it, the entry is optionally moveddown one position on the candidate next hop list. If the link cost ishigher than the threshold maximum, the entry is moved down the oneposition in the candidate next hop list. The system and method thenresumes sending communications using the node corresponding to the entryat the head of the candidate next hop list, which may not necessarily bethe entry with the lowest total cost.

When a communication is received for routing, if a fixed or variablenumber of communications have been routed since a previous time the topentry was not used (or since the previous time a different entry wasselected for the same reason), one of the other entries on the candidatenext hop list with a hop count not higher, or not significantly higher,than the hop count of the top of the candidate next hop list, and/orwith a total cost not significantly exceeding the top entry on thecandidate next hop list is selected, for example, at random from amongsuch entries or among entries not recently used or previously used forthis purpose, and the total cost of using the node corresponding to thatentry is identified by sending the received communication through thatnode and identifying the cost of using the node by adding the advertisedcost of the node to the cost of sending to that node, such cost being afunction of the number of attempts required to successfully sendmessages to that node in the same manner as was described above. Thetotal cost for the entry is again computed and the selected entry ismoved up (and optionally, or down) on the candidate next hop list in thesame manner as described above. However, unlike the case in which thenode corresponding to the entry at the head of the candidate next hoplist was unavailable as described above, in which case a node notcorresponding to the head of the candidate next hop list is used asingle time, the same node is selected and used repeatedly, and itsposition is optionally moved based on its cost as described herein,until its position on the candidate next hop list stabilizes. Sending ofcommunications then resumes using the node corresponding to the entry atthe head of the candidate next hop list until that node is unavailableor the number of messages is reached to make another random selection.

In this manner, the entries with total costs near, or lower than, theentry at the head of the candidate next hop list are repeatedly probedto ensure that the node with a consistently lowest cost will arrive atthe head of the candidate next hop list, while occasionally probingother nodes on the candidate next hop list to ensure that total costsfor other entries on the candidate next hop list are measured. Asdevices change their costs due to different locations, interference,etc., such costs are reflected in the order of the candidate next hoplist. As noted, the total cost for an entry without a known link cost isconsidered to be a very high total cost: the measurement of the actualtotal cost for such nodes allows such nodes to be considered for thedefault next hop node position. However, the lowest cost node may notalways be at the head of the candidate next hop list at any time, yetthe node at the head of the candidate next hop list may be used forrouting to a destination corresponding to the candidate next hop list.

Thus, the measured total cost of sending a communication to a node willimpact the position of the entry for that node on the candidate next hoplist, but when determining whether to insert an entry into the candidatenext hop list, the measured total cost is not fully identified,advertised cost is used instead, with signal quality used to break tiesand near ties, with preference given to existing members of thecandidate next hop list for which the link cost has not beenestablished. Thus, the order of the candidate next hop list can bemaintained for some next hop nodes even before a single message thatwould provide an accurate indication of their total cost is sent tothose nodes.

Costs to the next hop node may be computed using the ratio of successfultransmissions to the number of attempted transmissions to the node, ormay be computed using other methods. Because each node can use the samemethod of identifying the link cost to its neighbor nodes, the totalcost may be a function of the efficiency of the communication path, bothin terms of power that may be required to send a communication and thetime it will take. In other embodiments only some of the nodes use thismethod of identifying link costs to their next hop nodes and in stillother embodiments, none of the nodes use this method.

When a device advertises its cost of sending to the destination, itidentifies the total cost at the head of the candidate next hop list asits cost of sending messages to the destination. The cost advertised maybe adjusted using other issues, such as power issues, including whetherthe device has a large or small battery, or in accordance with latencyand/or throughput issues.

In this manner, the signal quality, such as RSSI is used, along with theadvertised total cost or another cost metric, to form an initialestimate of the total cost, which may be later measured by testingtransmissions sent to the node from which the beacon is received andreceiving an acknowledgement. Until the link cost is measured, theconfidence in the total cost is low. After an amount of testing hastaken place, entries near the bottom of the candidate next hop list willbe those in which the confidence in their total cost is low, and entriesnear the top of the candidate next hop list are those in which theconfidence is higher, due to being measured. Among the entries in whichconfidence is high, such entries will become sorted or nearly sortedbased on their total cost.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block schematic diagram of a conventional computer system.

FIG. 2, consisting of FIGS. 2A and 2B, is a flowchart illustrating amethod of accepting information from routing messages into a candidatenext hop list according to one embodiment of the present invention.

FIGS. 3A, 3B and 3C are a flowchart illustrating a method of managing acandidate next hop list of entries containing routing information androuting messages using the candidate next hop list according to oneembodiment of the present invention.

FIG. 3D is a flowchart illustrating a method of sending a beaconaccording to one embodiment of the present invention.

FIG. 4 is a block schematic diagram of a system for acceptinginformation onto a candidate next hop list of routing informationaccording to one embodiment of the present invention.

FIG. 5 is a block schematic diagram of a system for managing a candidatenext hop list of entries containing routing information and routingmessages using the candidate next hop list according to one embodimentof the present invention.

DETAILED DESCRIPTION OF A PREFERRED EMBODIMENT

The present invention may be implemented as computer software on aconventional computer system. Referring now to FIG. 1, a conventionalcomputer system 150 for practicing the present invention is shown.Processor 160 retrieves and executes software instructions stored instorage 162 such as memory, which may be Random Access Memory (RAM) andmay control other components to perform the present invention. Storage162 may be used to store program instructions or data or both. Storage164, such as a computer disk drive or other nonvolatile storage, mayprovide storage of data or program instructions. In one embodiment,storage 164 provides longer term storage of instructions and data, withstorage 162 providing storage for data or instructions that may only berequired for a shorter time than that of storage 164. Input device 166such as a computer keyboard or mouse or both allows user input to thesystem 150. Output 168, such as a display or printer, allows the systemto provide information such as instructions, data or other informationto the user of the system 150. Storage input device 170 such as aconventional floppy disk drive or CD-ROM drive accepts via input 172computer program products 174 such as a conventional floppy disk orCD-ROM or other nonvolatile storage media that may be used to transportcomputer instructions or data to the system 150. Computer programproduct 174 has encoded thereon computer readable program code devices176, such as magnetic charges in the case of a floppy disk or opticalencodings in the case of a CD-ROM which are encoded as programinstructions, data or both to configure the computer system 150 tooperate as described below.

In one embodiment, each computer system 150 is a conventional SUNMICROSYSTEMS ULTRA 10 workstation running the SOLARIS operating systemcommercially available from SUN MICROSYSTEMS, Inc. of Mountain View,Calif., a PENTIUM-compatible personal computer system such as areavailable from DELL COMPUTER CORPORATION of Round Rock, Tex. running aversion of the WINDOWS operating system (such as 95, 98, Me, XP, NT or2000) commercially available from MICROSOFT Corporation of Redmond Wash.or a Macintosh computer system running the MACOS or OPENSTEP operatingsystem commercially available from APPLE INCORPORATED of Cupertino,Calif. and the NETSCAPE browser commercially available from NETSCAPECOMMUNICATIONS CORPORATION of Mountain View, Calif. or INTERNET EXPLORERbrowser commercially available from MICROSOFT above, although othersystems may be used. In one embodiment, systems may be based on theconventional MSP430 commercially available from Texas Instruments, Inc.,of Dallas, Tex., or the atmega128 commercially available from AtmelCorporation, of San Jose, Calif., or the PXA xscale commerciallyavailable from Intel Corporation of Santa Clara, Calif. or other similarsystems. Such systems may run the conventional TinyOS, commerciallyavailable from the web site of SourceForge.net or another operatingsystem, such as a real time operating system.

Building the Candidate Next Hop List

Referring now to FIG. 2, consisting of FIGS. 2A and 2B, a method ofadding routing information to a candidate next hop list is shownaccording to one embodiment of the present invention. A beacon with costinformation is received along with the signal quality of the receivedbeacon 200. In one embodiment, the cost information is received as partof the beacon, and the signal quality is provided and received by aradio that receives the beacon. Signal quality information may include aconventional RSSI reading, though other signal quality information maybe used.

In one embodiment, each beacon contains an identifier of the node thatoriginated the beacon, a hop count indicating how many other nodes willbe traversed from that node when a communication is sent from the nodethat sent the beacon to a destination (which may be implied or may bespecified in the beacon) and a list of identifiers of the first N nodesthrough which the originator of the beacon routes communications to adestination, where N is some or all of the nodes up to a maximum, suchas four nodes. Other nodes may be used to route such communications, butwould not be on the candidate next hop list. Other embodiments containother numbers of nodes as the maximum, or no maximum.

As part of step 200, a determination is made as to whether the source ofthe beacon is a next hop node, or not a next hop node, of the recipient.In one embodiment, the beacon corresponds to a node that is a next hopof the recipient node if the list of such other nodes through which theoriginator of the beacon routes communications does not include anidentifier of the receiving node. In another embodiment, the beaconcorresponds to a node that is a next hop node if the hop countadvertised in the received beacon is equal to or less than, or notsignificantly (e.g. 20%) greater than, the hop count (or hop count tothe destination advertised in the received beacon) of the receivingnode, as described below. In one embodiment, a beacon corresponds to anode that is a next hop node if both of these tests are met. Otherwise,the node is a not a next hop node. The originator of the beacon is thenode that first sent the beacon. It is noted that the recipient nodemay, in fact, be on the route to the destination as node N+1 or greater.In that case, the recipient node will still identify the originatingnode as a next hop node, unless the hop count test is used or is alsoused.

As described herein, the destination for all communications is alwaysthe same and thus the beacons do not contain any indication of what thedestination actually is, unless the destination is within the first N(e.g. four) hops. In another embodiment, there may be any of severaldestinations, but each of the destinations is interchangeable with oneanother. For example, there may be several gateways from the wirelessdevices performing the method to a wired network. However, each gatewayis interchangeable with any other gateway, and thus a device that canreach one of the gateways in one hop would advertise the cost and numberof that hop as described herein. In still another embodiment, eachbeacon specifies the destination to which it pertains. In thisembodiment, a beacon includes an identifier of a destination. Step 200also includes determining whether the destination is tracked. This mayinvolve comparing the identifier of the destination in the beacon to asupplied list of destinations that should be tracked.

If the originating node is not a next hop node to the receiving node orthe destination is not tracked 202, information from the beacon is notadded to the candidate next hop list 228, and the method continues atstep 200. As part of step 228, the node identified as not being a nexthop node is checked to see if an entry for that node is already on thecandidate next hop list corresponding to the destination, and if so, theentry corresponding to that entry is removed from the candidate next hoplist.

If the beacon corresponds to a node that is a next hop node andoptionally, the destination is tracked 202, the candidate next hop listof entries corresponding to that destination is selected, and adetermination is made as to whether the signal quality exceeds athreshold, and whether the next hop node is already on the candidatenext hop list and if so, whether the cost information for that next hopnode has changed 204. In one embodiment, any change is identified as achange and in another embodiment, a change is only identified if thecost is outside a threshold of the cost stored in the correspondingentry on the candidate next hop list, such as 2%, or the signal qualityreceived is lower, or significantly lower (e.g. 10%) than the signalquality stored with the corresponding entry on the candidate next hoplist, or both.

The selected candidate next hop list will be used for all subsequentdealings with regard to the received beacon as described herein, and sothe candidate next hop list referred to herein is the candidate next hoplist that is selected.

If the next hop node is not on the candidate next hop list, if, in oneembodiment, the signal quality does not exceed the threshold 206 or, inone embodiment, the total cost (if known) exceeds the advertised cost ofthe default next hop node the method continues at step 228. In oneembodiment, the threshold may be set lower if there are no entries onthe candidate next hop list than it would if there were, and it may beset as a function of the number of entries on the candidate next hoplist. If the next hop node is not on the candidate next hop list and thesignal quality does exceed the threshold 206, the method continues atstep 212.

If the next hop node is on the candidate next hop list and the routingcost in the beacon is not identified as unacceptably different (e.g.more than ten percent, or, in one embodiment, the advertised cost ishigher than the total cost of the default next hop node on the candidatenext hop list), from the routing cost stored in the corresponding entryon the candidate next hop list for the node that originated the beacon206, or the signal quality is not unacceptably lower than the signalquality in the corresponding entry, or the weighted average signalquality is not below the threshold or otherwise unacceptably low, otherinformation from the beacon may be used to update 208 the entry on thecandidate next hop list corresponding to the device that originated thebeacon, for example, by updating the signal quality to a higher signalquality or the list of nodes through which such device initially routesmessages.

The signal quality may be used to identify a weighted average signalquality for the node that sent the beacon, for example, by multiplyingthe received signal quality by 0.8, multiplying the stored signalquality for that node by 0.2, summing them and updating the signalquality for the entry corresponding to the received beacon using theresult. Other weighting methods may be used, for example weighting thesignal quality according to the number of recent readings. The methodcontinues at step 200. In one embodiment, if the advertised costincreases, but not unacceptably so (e.g. it isn't above the highestadvertised cost on the candidate next hop list or isn't higher by acertain amount or percentage, such as five or ten percent), the totalcost for the updated entry on the candidate next hop list of next hopnodes is compared to the total cost of the entries above and below thatentry on the candidate next hop list, and if the total cost is lowerthan the total cost of the entry above, the order of those entries isswapped. If not, but the total cost of the entry updated is higher thanthe cost of the entry below it, the order of those two entries areswapped. In other embodiments, the swapping is not performed at thispoint. Total costs and swapping are described in more detail below.

If the next hop node is on the candidate next hop list and the routingcost in the message is unacceptably different (e.g. it is significantlyhigher), from the routing cost stored in the entry on the candidate nexthop list for the device that originated the message 206, or the receivedsignal quality is unacceptably lower than the signal quality stored inthe entry corresponding to the received message, or the weighted averagesignal quality would be below the threshold, the entry on the candidatenext hop list is deleted 210 and the method continues at step 218, whereinformation from the newly received message may be added as an entry.

At step 212, the candidate next hop list is investigated to determine ifthe candidate next hop list is empty, and if not, whether a timer isactive, whether the candidate next hop list is full, and in oneembodiment, if neither one of these are true, whether the advertisedcost in the beacon is higher than the total cost of the entry at thehead of the candidate next hop list.

If the timer is active or the candidate next hop list is empty 214,information from the beacon is added to the candidate next hop list ifspace is available on the candidate next hop list using a binary sorttype algorithm for placement, with the candidate next hop list kept insorted order of advertised cost, with ties and near-ties being broken infavor of signal quality (also referred to as link quality) 216.

Information from the beacon that is added to the entry includes theidentifier of the node that originated the beacon, the hop count thelist of N nodes through which it routes (or all but the last of thesenodes), the advertised cost (each of the foregoing received in thebeacon), and the measure of signal quality. A binary sort type algorithmputs the first entry at or near the center of the candidate next hoplist and other entries are added above or below that entry according tothe advertised cost of the beacon, with the placement a function of howmuch higher or lower the advertised cost is from the nearest costbeacon. Beacons that have similar, though not identical costs (e.g.within two, five or ten percent, or within a threshold amount of costs)are considered tied, with ties being broken in favor of the entry havingthe best signal quality. If the candidate next hop list was empty, thetimer is set as part of step 216. The timer is of relatively limitedduration, being as small as ten seconds in one embodiment, or a minuteor two in another embodiment. During this amount of time from when thetimer is set until it expires, the timer is considered to be active.

In one embodiment, if the candidate next hop list is not empty and thetimer is not active 214, if the advertised cost in the beacon is higherthan the total cost of the entry at the head of the candidate next hoplist 214, the beacon is discarded 236. In another embodiment, nocomparison is performed between the advertised cost and the total costof the entry at the top of the candidate next hop list and processingcontinues as is now described.

If the candidate next hop list is not empty and the timer is not active,if the candidate next hop list is not full 214, information from thebeacon, including an identifier of the beacon (such as an IP address orMAC address), the hop count from the beacon, the cost of routing throughthe originator of the beacon (all of which are part of the beacon), thelist of the first N nodes through which that node routes messages, andthe signal quality with which the beacon was received, is added to thebottom of the candidate next hop list 218, and the method continues atstep 200. The signal quality may include the conventional RSSI measureof signal quality, and may be received from a radio that receives thebeacon at the receiving node.

If the candidate next hop list is full 214, the routing cost of the nodethat sent the beacon is compared with the routing cost stored at theentry at the bottom of the candidate next hop list 220. If the routingcost advertised in the received beacon is much higher than the routingcost of the entry at the bottom of the candidate next hop list 222, thereceived beacon is discarded 226, and the method continues at step 200.If the routing cost of the originating node of the received beacon ismuch lower than the routing cost of the entry at the bottom of thecandidate next hop list, the last entry the in the candidate next hoplist is replaced with information from the received beacon, includingthe identifier of the node from which the beacon was received, the costprovided in that beacon, and the signal quality with which the beaconwas received 224, and the method continues at step 200. Much higher ormuch lower (or significantly higher or significantly lower) may be 2%,5%, 10% 15% or 20% in different embodiments.

If the cost in the beacon is about the same as the cost in the lastentry 222, for example if the two costs are within 15 to 20 percent ofone another, the signal quality of the received beacon is compared tothe signal quality stored in the entry at the bottom of the candidatenext hop list 230. The signal quality stored in the entry at the bottomof the candidate next hop list corresponds to the signal quality withwhich one or more previously received beacons from the device thatoriginated the beacon was received (which may have been weightedaveraged as described above). If the signal quality of the newlyreceived beacon is about the same or lower than the signal qualitystored in the entry at the bottom of the candidate next hop list 232,the received beacon is discarded 236 and the method continues at step200. If the signal quality of the received beacon is much better (e.g.two or three or five or ten or fifteen or twenty percent) than thesignal quality stored in the entry at the bottom of the candidate nexthop list 232, the last entry in the candidate next hop list is replacedwith information from the received beacon 234, including the identifierof the node that sent the beacon, the hop count and cost provided inthat beacon, and the signal quality with which the beacon was receivedand the first N nodes 234, and the method continues at step 200.

In another embodiment, the above criteria of steps 230-232 in oneembodiment, or 220-232 in another embodiment, are only evaluated if alink cost has been established for the bottom entry in the candidatenext hop list by testing it as described herein, and otherwise, thenewly received beacon will be discarded. Prior to step 230 in oneembodiment, or step 220 in another embodiment, a determination is madeas to whether the link cost is known for the bottom entry in thecandidate next hop list 270. If not 272, the method continues at step226, and otherwise 272, the method continues at step 220 or 230 asdescribed herein.

Thus, any of several approaches may be used. In one embodiment, entrieswith a known link cost may be preferred to entries without a known linkcost, even if the signal quality is in fact a bit lower for the entrywith the known link cost. In one embodiment, entries are considered tohave a known link cost if the number of communications that have beensent to the node exceeds a threshold, such number being maintained inthe entry. If no link cost has been established, the preference may befor the more recent message, and thus, if the signal quality of thenewly received message is about the same or higher, the entry at thebottom of the candidate next hop list is replaced with an entrycorresponding to the message, and otherwise, the message is discarded.In one embodiment, the entry at the bottom of the candidate next hoplist is preferred to a new message. In still another embodiment, thispreference expires a threshold amount of time after the entry at thebottom of the candidate next hop list is entered.

At the time the first entry is added, and shortly thereafter, entriesare added differently than they are later. Thus, when the timer isactive, entries are added to the candidate next hop list in nearlysorted order of the advertised cost, with ties and near ties broken infavor of signal quality. Once the timer has expired, entries are addedto the bottom of the candidate next hop list as described herein and maybubble their way up. It is noted that the list of N nodes (though whicha device routes) is described as such, and entries on that list need notchange their positions when positions of entries on the candidate nexthop list are changed as described herein, though they list of N nodesthat is sent as part of a beacon can change to reflect changes to theentry at the head of the candidate next hop list.

Using and Managing the Candidate Next Hop List

Referring now to FIGS. 3A, 3B and 3C, a method of managing a candidatenext hop list of routing information, and a method of routingcommunications using the candidate next hop list, is shown according toone embodiment of the present invention. A communication counter is setto zero 310. In one embodiment, the communication counter is storedassociated with each candidate next hop list, and counts thecommunications that are received and sent using the candidate next hoplist as described herein. A communication is received, a candidate nexthop list is selected corresponding to the destination received as partof the received communication, and the communication counter for theselected candidate next hop list is incremented 312. The selectedcandidate next hop list is the candidate next hop list referred to inthe remainder of the discussion with respect to the Figure. A check isperformed to determine whether the communication counter for theselected candidate next hop list indicates that the communication is oneof every Nth communications (e.g. the communication counter modulo N iszero), and whether there are next hop nodes on the candidate next hoplist to which communications have not been sent before.

In one embodiment, every Nth message is treated differently as describedherein, and if the communication is an Nth communication, such as every20 communications 314, the method continues at step 330 and otherwise314, the method continues at step 316. In one embodiment, such N may beselected in a manner (e.g. pseudo-randomly) that can allow the value ofN to change from time to time or after the prior value of Ncommunications have been received. In one embodiment, if the candidatenext hop list does not contain at least one entry that has a total costnearly as low (e.g. up to ten percent higher) or lower than the totalcost for the default next hop node 314, the method will also continue atstep 316, even if the communication is the Nth communication. It isnoted that N for the Nth communication may be different than the Nnumber of nodes through which a node routes.

At step 316, the entry in the candidate next hop list corresponding tothe default next hop node is selected, and an attempt counter for thecandidate next hop list is set to one. In one embodiment, the defaultnext hop node is the next hop node on top (i.e. the head) of thecandidate next hop list of routing information described herein. In oneembodiment, the default next hop node is the next hop node at the top ofthe candidate next hop list, which may or may not have the lowest costof routing a message to a gateway or other destination, than the otherentries on the candidate next hop list.

Each entry on the candidate next hop list describes a next hop node,which is a device that can be the next hop in a route to the gateway orother destination. In one embodiment, each entry in the candidate nexthop list contains an identifier, such as an IP address or other type ofunique address, of the next hop node corresponding to that entry, thehop count and cost advertised by the next hop node of sending acommunication from that next hop node to the gateway or otherdestination, identifiers of the first N hops from that node, and mayinclude the link cost, if known, of sending a communication to that nexthop node from the device performing the method or implementing some orall of the system, of the present invention. Each entry on the candidatenext hop list may also contain a measure of signal quality correspondingto one or more messages received from the device corresponding to theentry as described herein.

An attempt is made to send the communication to the gateway or otherdestination through the default next hop node and to listen for anacknowledgment indicating the attempt was successful 318. If the attemptwas successful because the acknowledgment has been received from thedefault next hop node 320, the number of attempts that was required tosuccessfully send a communication is identified using the attemptcounter and stored associated with the entry for the default next hopnode on the candidate next hop list, and a cost for sending using thedefault next hop node is identified and stored 322. In one embodiment,the number of attempts for each of the last five communications (oranother number of communications) is stored associated with the entryfor the next hop node to which such communications were sent, with thenumber of attempts being stored in the order in which communicationswere sent. Identifying the cost for the next hop node may includeaveraging the number of attempts it took to successfully send eachcommunication, or computing a weighted average of such number ofattempts per communication by weighting the most recent attempts moreheavily than the older attempts, in which case, each attempt andacknowledgement may be time stamped and the weight may be proportionalto the age of the attempt. The weighted average may instead be computedby multiplying the link cost stored with the entry for the default nexthop node by 0.2, multiplying the newly identified cost by 0.8 andstoring the sum of the result in the entry as the link cost for thedefault next hop node. In one embodiment, the link cost is a function ofonly the most recent attempt, the cost being equal to the number ofattempts at it took to successfully send the most recent communication.

The total cost of sending a communication through a next hop node is thesum of the link cost of sending to that next hop node, and the costadvertised by the next hop node in the beacon, and such cost of sendingto the next hop node is stored associated with the beacon informationfor that next hop node. Because each node can use the same manner ofidentifying its link cost, in one embodiment the total cost may be afunction of the ratio of attempts to communications for each of thelinks in the path to the destination. If the attempt made in step 318 isnot successful 320, for example because an acknowledgment is notreceived within a threshold amount of time, the number of attempts orattempts for the communication is incremented (and optionally, timestamped) and that number is compared to a threshold 324. If the numberdoes not exceed the threshold 326, the method continues at step 318. Ifthe number exceeds the threshold 326, the method continues at step 368of FIG. 3B.

Nth Communication Processing.

As noted above, step 330 is performed if the communication is the Nthcommunication and optionally, if an entry on the candidate next hop listexists with a total cost not significantly higher than the total costfor the default next hop node. As noted, N may be fixed or may bevariable, for example, selected randomly within a range of possiblevalues, for example 10 to 40. At step 330, one of the entries on thecandidate next hop list corresponding to a next hop node that has eithera hop count that is not greater than the hop count of the default nexthop node at the top of the candidate next hop list, or a total cost notsignificantly higher than the total cost of the default next hop node,or both is selected (e.g. at random, or the one not previously selectedfor this purpose or not selected for this purpose for the longest amountof time) and an attempt counter is set equal to one. In one embodiment,a preference is given to nodes that have not been selected or not beenselected for this purpose.

In one embodiment, step 330 includes selecting the next value of N to beused in the next iteration, though in one embodiment, N is fixed andneed not be selected at each iteration. In one embodiment, the value ofN is selected from a range of possible values using a conventionalprobability distribution. This value of N will be used at each iterationof step 312 and 314 until it is changed at step 330. In such embodiment,step 330 includes resetting the communication counter to zero.

An attempt is made to send the communication using the next hop nodecorresponding to the selected entry, and an acknowledgment is listenedfor 332. If the attempt is successful, because the acknowledgment isreceived from the next hop node corresponding to the selected entry 334,the number of attempts is identified using the attempt counter, and usedto compute a link cost for the selected entry, and the link cost isstored associated with that selected entry 336. In one embodiment, thelink cost for the selected entry is identified in the same manner as forthe entry for the default next hop node, as described herein and above.The method continues at step 350. If the attempt is unsuccessful 334,the attempt counter is incremented and compared to a threshold 338. Ifthe attempt counter has exceeded the threshold 340, the method continuesat step 368 of FIG. 3B in one embodiment, or at step 316 in anotherembodiment. If the number of attempts has not exceeded the threshold340, the method continues at step 332.

Upon successful completion of a message sent to a node that is not atthe head of the candidate next hop list, step 350 is performed. At step350, a total cost of the next hop node corresponding to the selectedentry is compared to the total cost of the next hop nodes above andbelow the selected next hop node on the candidate next hop list. In oneembodiment, the total cost is equal to the cost advertised by the nexthop node that is incurred in reaching the gateway starting with thatnext hop node, plus the link cost of reaching the next hop node,computed as described above (referred to as the “total cost”). In oneembodiment, entries on the candidate next hop list corresponding to nexthop nodes for which the link cost of reaching such next hop nodes is notknown are considered to have an infinite, or a very high, total cost.

If the result of the comparison is that the total cost of the next hopnode corresponding to the selected entry is higher than the total costof the next hop node corresponding to the entry immediately below theselected entry on the candidate next hop list 352, the entry for theselected next hop node is moved down one position on the candidate nexthop list 356 and the method continues at step 358. At step 358, when thenext communication is received, the attempt counter is set to one, andthe method continues at step 332 using the same selected entry. Thus,the selected entry will “bubble” its way down the candidate next hoplist in the same manner as a bubble sort, one position at a time. Otheralgorithms similar to other sorting algorithms may be used. In oneembodiment, moving down is not explicitly performed, as entries willmove down only when other entries move up, so step 358 is used insteadof step 356 as shown by the dashed line in the Figure.

If the result of the comparison is that the newly computed total cost ofthe next hop node corresponding to the selected entry is less than thatof the next hop node corresponding to the entry above the selected entryon the candidate next hop list 352, the entry for the selected next hopnode is moved up one position on the candidate next hop list 354, andthe method continues at step 358.

In one embodiment, moving an entry up involves swapping the order ofthat entry with the entry above it, and moving an entry down involvesswapping the order of the selected entry with the entry below thatentry. In one embodiment, the candidate next hop list has a logicalorder, and so moving the entries up or down includes changing thelogical order of the entries as described above, using conventionaltechniques.

If the total cost for the selected entry is neither higher than theentry below, or lower than the entry above 352, the method continues atstep 312 where the default next hop node will again be used. In oneembodiment, a swap is only performed if the costs are significantlydifferent, meaning different by more than an amount or a percentage ofthe total cost of the entry being considered for moving.

In one embodiment, if the newly computed link cost for the selectedentry exceeds a threshold, the entry will never be moved up, and in factwill be moved down as part of steps 350-354, even in the embodiment inwhich moving nodes down is not explicitly performed as a result ofcomparison of the total cost for the selected entry and the entry below.In such embodiment, step 352 also adds the criteria that the link costfor the selected entry exceeds the threshold, with step 354 beingperformed if the link cost exceeds the threshold. Thus, step 350includes checking to see that the link cost is less than the threshold.

Next Hop Node Unable to Send.

When a message is unable to be successfully sent by a selected next hopnode after a threshold number of attempts, step 368 is performed. Atstep 368 of FIG. 3B, an indication that the communication was notsuccessfully sent may be stored associated with the entry correspondingto the next hop node used to attempt to send the communication in thecandidate next hop list, and the cost of sending to that next hop nodemay be recomputed as described above. For example, if the number ofattempts is stored for each of the last five communications sent to thatnext hop node, a relatively large number (e.g. relative to the actualnumber of attempts that were sent), such as eight, may be used as thenumber of attempts for a communication that was not successfully sent,to indicate that the threshold had been exceeded on that attempt, or thenumber of attempts used may be the actual number of attempts. Thisnumber of attempts will increase the link cost of sending to the nexthop node to which the communication was not able to be sent, asdescribed above. Such action may be implemented when any other nodes areused in an attempt to send a communication, but the nodes do notacknowledge receipt as described herein.

Any entry on the candidate next hop list is randomly selected 370, andan attempt counter is set equal to one. In one embodiment, the selectiongives preference to those entries on the candidate next hop list notalready selected for this purpose or for any purpose. In one embodiment,selection is only made from among entries that have a hop count that isnot greater or not significantly greater (e.g. by more than 20%) thanthe hop count of the default next hop node of the selected list.

An attempt is made to send the communication using the next hop nodecorresponding to the selected entry and an acknowledgment is listenedfor 372. If the attempt is successful, because the acknowledgment isreceived from the next hop node corresponding to the selected entry 374,the number of attempts is identified using the value of the attemptcounter and used to compute a cost for the selected entry, and the costis stored associated with that selected entry 376. In one embodiment,the cost for the selected entry is identified in the same manner as forthe entry for the default next hop node, as described above. The methodcontinues at step 390 of FIG. 3C. If the attempt is unsuccessful 374,the attempt counter is incremented and compared to a threshold 378. Ifthe attempt counter has exceeded the threshold 380, the link cost of theselected entry may be adjusted as described above for an unsuccessfulattempt, steps 390 through 395, described below, are optionallyperformed, and the method continues at step 370. If the number ofattempts has not exceeded the threshold of 380, the method continues atstep 372.

At step 390 of FIG. 3C, the total cost of the next hop nodecorresponding to the selected entry is computed, stored associated withthe selected entry, and compared to the costs of the next hop nodesabove and below the selected next hop node on the candidate next hoplist.

If the result of the comparison is that the total cost of the next hopnode corresponding to the selected entry is significantly higher (e.g.over ten percent) than the cost of the next hop node corresponding tothe entry immediately below the selected entry on the candidate next hoplist 392, the entry for the selected next hop node is moved down oneposition on the candidate next hop list 395, and the method continues atstep 312. In one embodiment, moving down is not performed and step 395is skipped, with step 312 being taken instead as shown by the dashedline in the Figure. In one embodiment, step 395 is performed if the linkcost is below the threshold.

If the result of the comparison is that the newly computed total cost ofthe next hop node corresponding to the selected entry is significantly(e.g. over ten percent) less than that of the next hop nodecorresponding to the entry above the selected entry on the candidatenext hop list 392, the entry for the selected next hop node is moved upone position on the candidate next hop list 394, and the methodcontinues at step 312. If neither of the above is true 392, the methodcontinues at step 312 of FIG. 3A. As described above, if the link costfor the selected entry is above a threshold, the link is never moved upand always moved down as part of steps 390-394. Thus, step 390 includeschecking to see whether the link cost exceeds the threshold.

Thus, in contrast to the Nth communication causing an entry to beselected and used to send one or more communications until the positionof the entry on the candidate next hop list stabilizes, if the defaultnext hop node is unsuccessful at sending a communication, the differentselected entry is used only for that one communication, after which thedefault next hop node is used again or, in the case of yet anotherfailure, another selection of a different next hop node is made. Thenext hop node used to successfully send the communication may be movedup or down once, or not at all, but it will not bubble up or downfurther until a stabilization of its position is detected, as is thecase when the Nth communication is identified and a next hop node otherthan the default next hop node is identified and used to send acommunication as described above. Of course, the selected entryfollowing the initial failure of the default next hop node may be thesecond entry, and it may move up into position as the default next hopnode, causing it to be reused after the communication that the previousdefault next hop node could not send, or that entry may be reselectedupon the failure of the default next hop node to successfully send thenext communication, which could cause the selected entry to move two ormore positions.

It is noted that the receiving nodes need do nothing with respect to thesending nodes other than acknowledge when a message is received. Thereceiving nodes need not maintain information regarding which nodes mayreach the receiving node or the cost of doing so, and in one embodiment,no such information is maintained by a receiving node. The number ofnodes that can send through a receiving node does not increase storagerequirements for storing such reachability information on the receivingnode, and thus the system and method scales easily when many nodes routethrough a particular receiving node.

It is noted that, in one embodiment, an entry for a node will bubble itsway up to become the default next hop node if the node has both asufficiently high signal quality (which will translate to a low ratio ofattempts to successful completions) and a low advertised cost relativeto other nodes through which the node maintaining the candidate next hoplist may route communications. If only one of these criteria is met, butthe other criteria is far out of the range of other nodes through whichthe node maintaining the candidate next hop list can route, the node isunlikely to become the default next hop node.

It is noted that, in one embodiment, there is a cooperation between thelink layer, where the communication success rate is determined, and thenetwork layer, which selects the entry on the candidate next hop list touse. The network layer periodically allows data to be gathered regardingthe link layer (e.g. the communication success rate for a node), evenfor non default next hop nodes, yet the communication success rate maybe used to determine the default next hop node. Additionally, a failureat the link layer can cause the network layer to obtain additional linklayer information.

Sending Beacons.

Each of several nodes may perform the method described above.Additionally, each node may periodically or occasionally send its ownbeacon, including the total cost of sending a communication through itsdefault next hop node, its hop count, a list of identifiers of nodesthrough which the node originating the beacon will route communicationsthat contains the identifier of its own default next hop node and allbut the last node identifiers provided by the default next hop node asits list of identifiers of nodes through which it routes communications,and the identifier of the node originating the communication.

Referring now to FIG. 3D, a method of sending a beacon is shownaccording to one embodiment of the present invention. The total cost,hop count incremented by one, and all but the last one of the N nodesidentified by the default next hop node in its beacon are identifiedfrom the candidate next hop list 396 and the identifier of the defaultnext hop node is added to the top of the list of N−1 nodes to completethe list of first N nodes through which the node sending the beacon willroute communications. If different destinations are used, each candidatenext hop list may have its own destination, and an identifier of thedestination is also identified.

In one embodiment, the cost advertised in the beacon may include anadjustment to the total cost of routing through the lowest cost node bymultiplying the link cost by a factor and adding the result to the totalcost or by adding an amount to the total cost, the factor or amountbeing a function of a physical characteristic of the node originatingthe beacon. For example, if one node has one size battery, the factor oramount may be higher than if the node had a larger sized battery, or wasline powered. Or a node with a low battery could use a higher factor oramount than the same node with a more full battery. A node that is solarpowered with a battery backup may use a higher factor or amount at nightor as nighttime approaches than one that is line powered. The factorallows, for example, nodes with a characteristic, such as a largerbattery, a fuller battery or line power, to be used more frequently toroute communications than those with a smaller battery, less fullbattery or those without line power or those otherwise expecting orexperiencing a shortage of power. The hop count may also be adjusted bya factor corresponding to a physical characteristic of the devicesending the beacon, such as the source of power described above.

Such an optional adjustment to the total cost of routing through thenext hop node is identified 397. The beacon is built containing thetotal cost of the default next hop node or the adjusted total cost ofthe default next hop node, the hop count or adjusted hop count, the listof N nodes through which the originator of the beacon will routecommunications, and the identifier of the originating node, andoptionally the destination, and the beacon is broadcast, wirelessly 398.In one embodiment, no destination or indication of a destination isbroadcast with the beacon, though in other embodiments, differentbeacons may be broadcast for different destinations, either one afterthe other or on different schedules. Broadcast beacons are used to routemessages by other nodes in the same manner as described herein.

After a period of delay 399, the method continues at step 396. Step 399may include selecting a different candidate next hop list, so thatbeacons corresponding to each candidate next hop list are sent in around robin fashion. In one embodiment, a single beacon is sentcontaining the information described above for each of every candidatenext hop list maintained by a device.

System.

Receive Beacon.

FIG. 4 is a block schematic diagram of a system for acceptinginformation onto a candidate next hop list of routing informationaccording to one embodiment of the present invention. Referring now toFIG. 4, at any time, beacon receiver 412 may receive a beacon via radio410. In one embodiment, radio 410 is a conventional IEEE802.15.x-compatible radio that provides some or all of the capabilitiesdescribed by one or more 802.15.x specifications. Radio 410 transmitsand receives data over a wireless network, though wired networks mayalso be used. Other radios and/or protocols may be used, such as theconventional 802.11a/b/g/h or other similar protocols. In oneembodiment, beacon receiver 412 also receives from radio 410 the signalquality with which the beacon was received, for example as aconventional RSSI reading.

When beacon receiver 412 receives the beacon and the signal quality,beacon receiver 412 parses the beacon and adds the information in thebeacon and a measure of the signal quality to a new beacon record thatbeacon receiver 412 stores in beacon information storage 416. In oneembodiment, beacon information storage 416 includes conventional memoryor disk storage, and may also include a conventional database. In oneembodiment, the information in the beacon includes the identifier of theoriginator of the beacon, a list of identifiers of the N nearest nodesthrough which the node that generated the beacon routes messages, whereN is some or all of the nodes up to a maximum, such as four nodes. Thebeacon information also includes the hop count and the cost of routing amessage through the node that generated the beacon, as described herein.The beacon may include an identifier of a destination. Beacon receiver412 provides a pointer to the newly created beacon record to next hopdeterminer 414.

Determine Whether Origin is Next Hop Node and Destination Should beTracked.

When next hop determiner 414 receives the pointer, next hop determiner414 locates the beacon record in beacon information storage 416, anduses in the beacon information in the beacon record to determine if thesource of the beacon is a next hop node to the node in which beaconreceiver 412 resides and, optionally, whether the destination is onethat the device containing next hop determiner 414 is intended to track.In one embodiment, the originator of the beacon is a next hop node if A)the list of nodes through which the node that generated the beaconroutes messages does not include the identifier of the node in whichnext hop determiner 414 resides B) the hope count in the beacon is nothigher than the hop count of the node receiving the beacon, or both ofthese. In one embodiment, the identifier of the node in which next hopdeterminer 414 resides and the list of destinations the device shouldtrack are received from a system administrator and stored in beaconinformation storage 416, and next hop determiner 414 locates thisidentifier and the list of destinations and compares it to theidentifiers included in the beacon information in order to determine ifthe source of the beacon is a next hop node and the destination is onethat should be tracked.

If next hop determiner 414 determines that the source of the beacon isnot a next hop node or the destination should not be tracked, in oneembodiment next hop determiner 414 deletes the beacon record from beaconinformation storage 416. Otherwise, next hop determiner 414 provides thepointer to the beacon record to on list processor 418.

In one embodiment, if the source of the beacon is not a next hop node,next hop determiner 414 determines if the beacon corresponds to an entryon the candidate next hop list for the destination stored in beaconinformation storage 416 and if so, removes such entry from the candidatenext hop list as described above.

Determine if on Candidate Next Hop List of Candidate Nodes, Process.

When it receives the pointer, on list processor 418 determines if anentry for the beacon is on the candidate next hop list corresponding tothe destination and originator of the beacon in the beacon record,determines if any changes are unacceptable and determines if the signalquality is or has dropped below the threshold as described above. Onlist processor 418 then deletes or updates the entry or discards thebeacon as described above with respect to steps 204-210 and 228 in FIG.2 above, or if no such entry is on the candidate next hop list for thedestination and the signal quality is greater than the threshold for thecandidate next hop list at that time as described above, provides thepointer to minimum cost determination manager 424 in one embodiment, orto empty list manager 426 in another embodiment.

Check for Advertised Cost Less than Total Cost of Default Next Hop Node.

When it receives the pointer, minimum cost determination manger 424determines if the advertised cost is greater than the total cost of thedefault next hop node. If so, minimum cost determination manager 424discards the beacon record corresponding to the pointer, and otherwise,provides it to empty list manager 426.

Check for Empty Candidate Next Hop List or Timer from Empty CandidateNext Hop List.

When it receives the pointer, empty list manager 426 checks thecandidate next hop list corresponding to the destination of the beaconrecord and if the candidate next hop list is nonexistent, creates it inbeacon information storage 416 and adds the identifier of thedestination from the beacon record to the candidate next hop list.Additionally, or if a candidate next hop list is found, but thecandidate next hop list is empty, empty list manager 426 sets a flag inthe candidate next hop list to indicate that the candidate next hop listwas empty and sets a timer using the operating system (not shown). Whenthe timer elapses, empty list manager 426 clears the flag. Empty listmanager 426 adds the information from the beacon record to the middle ornear middle of the candidate next hop list. In one embodiment, thecandidate next hop list is dynamic, consisting of a head of listpointer, tail of list pointer. Empty list manager 422 creates ahead-of-list pointer to the newly created entry, and a tail-of-listpointer to the newly created entry, and stores both pointers in beaconinformation storage 416. Entries may be linked to one another in orderusing a linked list, doubly liked list or an array.

If the candidate next hop list is not empty, empty list manager 426checks the flag. If the flag is set, empty list manager 426 adds theinformation from the beacon record as an entry for the candidate nexthop list as described above. In this manner, messages subsequent to thereceipt of the message that caused the timer to be set will be added tothe candidate next hop list as described above until the timer elapsesas described above.

If the candidate next hop list exists, is not empty and the flag is notset, empty list manager 426 provides the pointer to the beacon record tolist complete identifier 420

Determine if Candidate Next Hop List is Full.

When list complete identifier 420 receives the pointer to the beaconrecord, list complete identifier 420 checks the candidate next hop listcorresponding to the destination in the beacon record in beaconinformation storage 416 as described herein, to determine if thecandidate next hop list is full. In one embodiment, the candidate nexthop list is full if it already contains a predetermined number ofentries, such as five or ten or twenty or any other number. The numbermay depend on the available storage and the number of destinations thatmay be tracked. If the candidate next hop list is not full, listcomplete identifier 420 provides the pointer to list adder 422, andotherwise, list complete identifier 420 provides the pointer to costcompare manager 430, which proceeds as described herein and below.

Candidate Next Hop List not Full.

When list adder 422 receives the pointer to the beacon record, listadder 422 includes the information stored in the beacon record as anentry for the candidate next hop list, including the cost of routingthrough the node that sent the beacon and the signal quality with whichthe beacon was received, in the entry. In one embodiment, list adder 422also deletes the beacon record from beacon information storage 416. Thecandidate next hop list may be the candidate next hop list correspondingto the destination.

To add the entry, if there is already a candidate next hop list storedin beacon information storage 416, list adder 422 links a new entry tothe end of the candidate next hop list, for example by finding thetail-of-list pointer stored in beacon information storage 416, andadding a link from the entry indicated by the tail-of-list pointer tothe new entry. List adder 422 includes in the new entry the informationstored in the beacon record, including the cost of routing through thenode that sent the beacon, the hop count from the beacon, the identifierof the originator of the beacon, at least the first N−1 nodes from thelist of the first N nodes included with the beacon, and the signalquality with which the beacon was received. List adder 422 also changesthe tail-of-list pointer to point to the newly created entry. In oneembodiment, list adder 422 also deletes the beacon record from beaconinformation storage 416.

Candidate Next Hop List Full.

When cost compare manager 430 receives the pointer to the beacon recordfrom list complete identifier 420 as described herein and above, costcompare manager 430 uses the tail-of-list pointer stored in beaconinformation storage 416 to find the last entry in the candidate next hoplist, and compares the routing cost and signal quality included in thatentry to the routing cost and signal quality included in the beaconrecord. The candidate next hop-list used corresponds to the destinationin the record corresponding to the pointer. If the routing cost includedin the entry is much lower than the routing cost included in the beaconrecord, for example more than 20 percent lower, in one embodiment costcompare manager 430 deletes the beacon record from beacon informationstorage 416.

If the routing cost included in the last entry is much greater than therouting cost included in the beacon record, for example more than 20percent greater, cost compare manager 430 replaces the information inthat entry with the information from the beacon record, and in oneembodiment deletes the beacon record from beacon information storage416.

If the routing cost included in the entry is about the same as therouting cost included in the beacon record, for example if the two costsare within 20 percent of one another, cost compare manager 430 providesthe pointer to the beacon record to signal quality compare manager 440.

As noted above, in one embodiment, if the last entry in the candidatenext hop list does not have a link cost established by sending to thatdevice, in one embodiment, cost compare manager 430 deletes the beaconrecord from beacon information storage 416 and does not add it to thecandidate next hop list.

When signal quality compare manager 440 receives the pointer, signalquality compare manager 440 uses the tail-of-list pointer stored inbeacon information storage 416 to find the last entry in the candidatenext hop list, and compares the signal quality included in that entry tothe signal quality included in the beacon record. If the signal qualityincluded in the entry is much better than the signal quality included inthe beacon record, for example more than 20 percent better in theembodiment that signal quality is indicated by a numerical measurement,signal quality compare manager 440 replaces the information in thatentry with the information from the beacon record, and in one embodimentdeletes the beacon record from beacon information storage 416.Otherwise, in one embodiment signal quality compare manager 440 deletesthe beacon record from beacon information storage 416.

In one embodiment, if the last entry on the candidate next hop list doesnot have a link cost established by sending a message to the device towhich the entry corresponds, signal quality compare manager 440 deletesthe beacon record from beacon information storage and does not add it tothe candidate next hop list.

Managing the Candidate Next Hop List.

FIG. 5 is a block schematic diagram of a system for managing a list ofentries containing routing information, and for routing messages usingthe list according to one embodiment of the present invention. Referringnow to FIG. 5, at any time, at system start up, message receiver 512initializes a message counter to zero, and stores the message counter inmessage storage 514. In one embodiment, message storage 514 includesconventional memory or disk storage. If there are multiple destinationstracked, there is a message counter for each destination tracked, andeach one is initialized to zero by message receiver 512.

At any time, communication receiver 512 may receive a communication, forexample from an application (not shown). The application may havereceived the communication for retransmission via radio 510 or thecommunication may have been originated by the application or anotherapplication in communication with the application. In one embodiment,radio 510 is a conventional IEEE 802.15.x-compatible radio that providessome or all of the capabilities described by one or more 802.15.xspecifications. Radio 510 transmits and receives data over a wirelessnetwork, though wired networks may also be used. Other radios and/orprotocols may be used, such as the conventional 802.11a/b/g/h or othersimilar protocols. When communication receiver 512 receives thecommunication, communication receiver 512 stores the communication andthe identifier of the communication (received with the communication) incommunication storage 514. Communication receiver 512 also provides apointer to the communication to Nth communication identifier 520.

Check for the Nth Communication.

When Nth communication identifier 520 receives the pointer, Nthcommunication identifier 520 increments the communication countercorresponding to the destination of the communication in communicationstorage and checks its value. If the communication counter correspondsto a multiple of a prior determined value of N, e.g. 20, Nthcommunication identifier 520 provides the pointer to the communicationto Nth next hop identifier 550, which proceeds as described herein andbelow, and otherwise, Nth communication identifier 520 provides thepointer to default next hop selector 522. In one embodiment, Nthcommunication identifier 520 identifies as described above the nextvalue of N to be used if the communication counter corresponds to N, andalso resets the counter.

Select the Default Next Hop Node.

When default next hop selector 522 receives the pointer to thecommunication in communication storage 514, default next hop selector522 initializes an attempt counter to one and stores the attempt counterassociated with the communication in communication storage 514. Defaultnext hop selector 522 also selects a default next hop node correspondingto the destination of the message. To do so, in one embodiment defaultnext hop selector 522 may for example find a candidate next hop listmatching the destination, such candidate next hop list being stored inlist storage 516 and including the identifiers of next hop nodes, andfor each such next hop node, the hop count, the cost of sending acommunication to that node and the cost of sending a communication fromthat node to the gateway, along with additional information as describedherein. The candidate next hop list may be created as described hereinand in the related application and maintained as described herein. Inone embodiment, list storage 516 includes conventional memory and diskstorage. In this embodiment, default next hop selector 522 selects thefirst next hop node identified in the candidate next hop list as thedefault next hop node. When default next hop selector 522 has selectedthe default next hop node, default next hop selector 522 stores theidentifier of the default next hop node and the identifier of thedestination in communication storage 514, associated with thecommunication. Default next hop selector 522 also provides a pointer tothe communication to communication sender 524. Because the default nexthop node is thus selected near in time to when the message is received,the default node selected is the default node in effect about at thetime the message is received or sent.

When communication sender 524 receives the pointer as described herein,communication sender 524 locates the communication in communicationstorage 514, and adds a unique sequence number to the communication ifthe communication does not already include a sequence number. In oneembodiment, communication sender 524 also internally stores a sequencecounter for each potential destination and identifier of the destinationand default next hop node, and to add the sequence number to thecommunication, communication sender 524 uses the value of the sequencecounter for the destination corresponding to the message. In thisembodiment, communication sender 524 increments the sequence counter forthe destination after adding the previous sequence counter value to thecommunication. The communication may contain the identifier of thedestination to which it should be sent.

Attempt to Send Communication to Default Next Hop Node.

When communication sender 524 has added the sequence number to thecommunication, communication sender 524 attempts to send thecommunication to the next hop node corresponding to the node identifierassociated with the communication in communication storage 514, forexample via radio 610. In one embodiment, communication sender 524includes with the communication a unique identifier of the node in whichcommunication sender 524 resides, which communication sender 524 may forexample receive from a system administrator and internally store.

In one embodiment, communication sender 524 includes a conventionalclock, and when communication sender 524 sends a communication,communication sender 524 retains the sequence number corresponding tothat communication and a timestamp of the time the communication wassent. In this embodiment, communication sender 524 periodically (e.g.every second) checks the retained sequence numbers and timestamps, andif more than a predetermined amount of time (e.g. ten seconds) haspassed since a communication corresponding to any of the retainedsequence numbers was sent, communication sender 524 determines that thecorresponding communication has not been successfully sent.

When communication sender 524 determines that a communication has notbeen successfully sent, communication sender 524 provides the sequencenumber and identifier of the destination and identifier of the defaultnext hop node corresponding to the communication to attempt manager 532,which proceeds as described herein and below. In one embodiment,communication sender 524 does not continue to retain the sequence numberor associated information.

Attempt Successful

At any time, communication sender 524 may receive an acknowledgement toa communication from a next hop node, via radio 610. In one embodiment,acknowledgements include the node identifier and corresponding sequencenumber of the communication to which the acknowledgement corresponds.When communication sender 524 receives the acknowledgement,communication sender 524 compares the node identifier included in theacknowledgement to the identifier of the node in which communicationsender 524 resides, and discards the acknowledgement if the two nodeidentifiers do not match. If the node identifiers match, communicationsender 524 compares the sequence number included in the acknowledgementto any retained sequence numbers, and discards the acknowledgement ifthe sequence number does not match a retained sequence number.

If the acknowledgement matches a retained sequence number, communicationsender 524 determines that the communication corresponding to thatsequence number has been successfully sent, and communication sender 524provides the sequence number, and identifiers of the default next hopnode and destination to next hop statistics manager 530 and anindication that the attempt was successful. Communication sender 524discards the node identifier and sequence number.

When next hop statistics manager 530 receives the sequence number andidentifiers from communication sender 524 because of the indication thatthe communication has been successfully sent, next hop statisticsmanager 530 locates the communication corresponding to that sequencenumber, next hop identifier and destination in communication storage514. Next hop statistics manager 530 identifies the value of the attemptcounter associated with that communication in communication storage 514and, using the next hop node identifier and destination identifier, nexthop statistics manager 520 locates the entry corresponding to the nexthop node on the candidate next hop list corresponding to the destinationin list storage 516, and in one embodiment adds the value of the attemptcounter to that entry and optionally other information as describedabove. In one embodiment, candidate next hop list entries may includethe attempt values for up to a predetermined number, e.g. five, of thelast communications sent using the next hop node corresponding to thatentry, and if the entry already includes that number of attempt values,next hop statistics manager 520 removes the first such attempt value andadds the most recent attempt value as the last attempt value. Next hopstatistics manager 530 also determines the link cost of sending acommunication to the node corresponding to the node corresponding to theentry, for example by averaging the attempt values stored in the entryas described herein. In another embodiment, no prior attempt values arestored in the entry, and next hop statistics manager 530 determines thatthe link cost of sending a communication to the node as the value of theattempt counter or by weighting the attempt counter and the existinglink cost as described above. Next hop statistics manager 530 stores thecost of sending a communication to the node in the entry, replacing anypreviously stored cost of sending a communication to the node. In oneembodiment, the system proceeds when a new communication is received asdescribed herein and above.

Attempt Unsuccessful.

When attempt manager 532 receives the sequence number, and identifiersof the destination and default next hop node from communication sender524 as described herein and above, attempt manager 532 locates thecommunication corresponding to that sequence number in communicationstorage 514 and increments the attempt counter associated with thatcommunication. Attempt manager 532 compares the value of the newlyincremented attempt counter to a predetermined threshold value, forexample, five. If the value of the newly incremented attempt counterexceeds the threshold, attempt manager 532 provides a pointer to thecommunication and/or the identifiers of the destination to untriedselection manager 540 and provides a pointer to the communication and/orthe identifiers of the destination and next hop node and an indicationthat the attempt was unsuccessful to next hop statistics manager 530,which proceeds as described herein and below. Otherwise, if the value ofthe newly incremented attempt counter does not exceed the threshold,attempt manager 532 provides a pointer to the communication tocommunication sender 524, which repeats the process of attempting tosend the communication to the next hop node as described herein andabove but maintains the attempt counter value.

When next hop statistics manager 530 receives the pointer to thecommunication from attempt manager 532, and the identifiers of thedestination and the next hop node, because attempt manager 532 includedthe indication that the attempt was unsuccessful, next hop statisticsmanager 530 locates the next hop node identifier associated with thatcommunication in communication storage 514, and locates the candidatenext hop list entry including that node identifier on the candidate nexthop list corresponding to the destination in list storage 516. Next hopstatistics manager 530 in one embodiment adds an attempt value to theentry, as the last attempt value in the entry, corresponding to arelatively large number, for example eight, and deletes the firstattempt value included in the entry if more than the predeterminednumber of attempt values are already included in the entry, or weightsthe attempt value with the existing link cost for the entry or replacedthe link cost with the attempt value as described herein and above. Nexthop statistics manager 530 also determines the total cost of sending acommunication to the node corresponding to the entry as described hereinand above, and stores the total cost of sending a communication to thenode in the entry, replacing any previously stored total cost of sendinga communication to the node.

Selection of Non Default Node to Send Communication Unsuccessfully Sent.

When untried selection manager 540 receives a pointer to thecommunication and the destination, untried selection manager 540 usesthe candidate next hop list corresponding to the destination to locateany entry that has not been marked as having been selected for thispurpose before, as described above, and if such an entry is located, itmarks the entry, for example with the date and time.

If it does not locate any such entry, untried selection manager 540locates any entry, or the entry with the oldest date and time which mayor may not include the entry at the head of the candidate next hop list.Untried selection manager 540 stores the identifier of the located nexthop node and the identifier of the destination in communication storage514, associated with the communication and provides a pointer to thecommunication and an indication that processing should resume by untriedselection manager 514 to communication sender 524, which repeats theprocess described above, sending via the next hop node identifierassociated with the communication. However, communication senderprovides the indication to next hop statistics manager 530 whichprovides untried selection manager 514 the identifier of the destinationand the identifier of the next hop node.

When it receives these items from next hop statistics manager 530,untried selection manager 514 uses the information stored in thecandidate next hop list corresponding to the destination it receives andthe criteria outlined above to determine whether to move the entrycorresponding to the next hop node up or down as described above. If theentry should be moved up, untried selection manager 514 provides theidentifier of the next hop node and the destination to move up manager544, which moves the corresponding entry up in the candidate next hoplist corresponding to the destination as described above. If the entryshould be moved down, untried selection manager 514 provides theidentifier of the next hop node and the destination to move down manager546, which moves the corresponding entry down in the candidate next hoplist corresponding to the destination as described above.

Nth Communication Selection of Next Hop Node.

When Nth next hop selector 550 receives the communication, using theselection criteria described above with reference to step 330 of FIG. 3Aabove, Nth next hop selector 550 selects an entry from the candidatenext hop list corresponding to the destination associated with thecommunication and associates the identifier of the selected next hopnode corresponding to the entry with communication corresponding to thepointer it receives, marks the selected entry, for example with the dateand time, and provides a pointer to the communication and an indicationthat processing should resume by Nth next hop selector 550 tocommunication sender 524, which repeats the process described above,sending via the next hop node identifier associated with thecommunication. Again, the node selected in this manner will be selectedusing the candidate next hop list in effect at least near the time thecommunication was received or sent. However, communication sender 524provides the indication to next hop statistics manager 530 whichprovides Nth next hop selector 550 the identifier of the destination andthe identifier of the next hop node.

When it receives these items from next hop statistics manager 514, Nthnext hop selector 550 uses the information stored in the candidate nexthop list corresponding to the destination it receives and the criteriaoutlined above to determine whether to move the entry corresponding tothe next hop node up or down as described above. If the entry should bemoved up, Nth next hop selector 550 provides the identifier of the nexthop node and the destination to move up manager 544, which moves thecorresponding entry up in the candidate next hop list corresponding tothe destination as described above. If the entry should be moved down,Nth next hop selector 550 provides the identifier of the next hop nodeand the destination to move down manager 546, which moves thecorresponding entry down in the candidate next hop list corresponding tothe destination as described above. As noted, the entry may not actuallymove down. An entry moved into the top or bottom position is one thatwill not be moved up or down, and so respectively.

If it determines that the entry should be moved up or down, Nth next hopselector 550 sets the flag associated with the candidate next hop listcorresponding to the destination, and otherwise Nth next hop selector550 clears the flag. When Nth message identifier 520 receives thepointer to the communication, it will first check the flag. If the flagis set, it treats the communication the same as if it were an Nthcommunication, and may or may not increment the communication counter.

Sending Beacons.

As described in the related application at various times, beacon manager560 may build and send a beacon for each candidate next hop list, whichit performs as described above with reference to FIG. 3D. Beacon manager560 may send the link cost and or hop count and advertised cost of thedefault next hop node to beacon cost adjuster 562, which calculates thetotal cost and or hop count as described with reference to step 397 ofFIG. 3D and provides the cost to beacon manager 560, which includes thecost in the beacon.

What is claimed is:
 1. A method comprising: receiving, at a firstnetwork node, a beacon message from a second network node, wherein thebeacon message includes an advertised cost of routing messages to adestination through the second network node; determining, based oninformation included in the beacon message, whether the second networknode is a next hop node of the first network node for routing messagesto the destination; in response to the second network node being a nexthop node of the first network node for routing messages to thedestination, selecting a candidate next hop list of entriescorresponding to the destination; determining whether the second networknode is present in the candidate next hop list; in response to thesecond network node not being present in the candidate next hop list,determining whether the candidate next hop list is empty and if notwhether a timer is active; and in response to determining that thecandidate next hop list empty and if not, that the timer is active,adding to an entry in the candidate next hop list information from thebeacon message.
 2. The method of claim 1, wherein the second networknode is a neighboring node of the first network node.
 3. The method ofclaim 1, wherein the entry in the candidate next hop list informationfrom the beacon message includes: at least one of an identifier of thesecond network node, a hop count from the second network node to thedestination and a list of identifiers of nodes in a routing path fromthe second network node to the destination.
 4. The method of claim 3,wherein determining whether the second network node is a next hop nodeof the first network node for routing messages to the destinationcomprises: determining at least one of whether the list of identifiersof nodes in the routing path includes the first network node and whetherthe hop count included in the beacon message is at most greater by apredetermined percentage compared to a hop count from the first networknode to the destination.
 5. The method of claim 1, wherein determiningwhether the second network node is a next hop node of the first networknode for routing messages to the destination comprises determiningwhether the first network node is tracking next hop nodes for routingmessages to the destination.
 6. The method of claim 1, furthercomprising: based on receiving the beacon message, measuring a signalquality associated with the beacon message; determining whether thesignal quality exceeds a threshold; in response to determining that asignal quality exceeds the threshold and the second network node ispresent in the candidate next hop list, determining whether costinformation associated with an entry for the second network node in thecandidate next hop list has changed, wherein the cost information isdetermined as changed if at least one of a difference in the advertisedcost included in the beacon message and a total cost stored in thecorresponding entry is greater than a first predetermined threshold, anda difference between the measured signal quality and a signal qualitystored in the corresponding entry is greater than a second predeterminedthreshold.
 7. The method of claim 6, further comprising: based ondetermining that the cost information has changed, computing whether achange in the cost information is within a predetermined changethreshold; and based on computing that the change in the costinformation is within the predetermined change threshold, updating anentry corresponding to the second network node in the candidate next hoplist with the advertised cost included in the beacon message.
 8. Themethod of claim 7, further comprising: comparing a total cost of anupdated entry with total costs of adjacent entries in the candidate nexthop list; and based on the comparing, swapping the updated entry withthe adjacent entries such that the updated entry and the adjacententries are arranged in the candidate next hop list in an order ofincreasing total cost.
 9. The method of claim 1, wherein adding to anentry in the candidate next hop list comprises: storing a measure of asignal quality of the beacon message in the entry; and sorting entriesin the candidate next hop list such that the entries are arranged in asorted order of advertised cost.
 10. The method of claim 1, furthercomprising: determining whether the candidate next hop list is full;based on determining that the candidate next hop list is full,establishing whether the advertised cost included in the beacon messageis lower by at least a predetermined level compared to a cost includedin a bottom entry at an end of the candidate next hop list; and based onestablishing that the advertised cost is lower by at least thepredetermined level compared to the cost included in the bottom entry,replacing information in the bottom entry with information included inthe beacon message, including an identifier of the second network node,the advertised cost and a measure of a signal quality.
 11. The method ofclaim 10, further comprising: based on establishing that the advertisedcost is within the predetermined level compared to the cost included inthe bottom entry, determining whether a measure of signal quality isincluded in the bottom entry; based on determining that the measure ofsignal quality is included in the bottom entry, deciding whether thesignal quality associated with the beacon message is better by at leasta predetermined level compared to the signal quality included in thebottom entry; and based on deciding that the signal quality associatedwith the beacon message is better by at least the predetermined level,replacing information in the bottom entry with information included inthe beacon message, including the identifier of the second network node,the hop count, the advertised cost and the measure of the signalquality.
 12. A computer program product embodied in a computer-readablenon-transitory medium including instructions executable by a processorand configured to cause the processor to perform operations comprising:receiving, at a first network node, a beacon message from a secondnetwork node, wherein the beacon message includes an advertised cost ofrouting messages to a destination through the second network node;determining, based on information included in the beacon message,whether the second network node is a next hop node of the first networknode for routing messages to the destination; in response to the secondnetwork node being a next hop node of the first network node for routingmessages to the destination, selecting a candidate next hop list ofentries corresponding to the destination; determining whether the secondnetwork node is present in the candidate next hop list; in response tothe second network node not being present in the candidate next hoplist, determining whether the candidate next hop list is empty and ifnot, whether a timer is active; and in response to determining that thecandidate next hop list is empty and if not, that the timer is active,adding to an entry in the candidate next hop list information from thebeacon message.
 13. The computer program product of claim 12, whereinthe instructions cause the processor to perform operations comprising:based on receiving the beacon message, measuring a signal qualityassociated with the beacon message; determining whether the signalquality exceeds a threshold; based on determining that the signalquality exceeds a threshold and the second network node is present inthe candidate next hop list, determining whether cost informationassociated with an entry for the second network node in the candidatenext hop list has changed, wherein the cost information is determined aschanged if at least one of a difference in the advertised cost includedin the beacon message and a total cost stored in the corresponding entryis greater than a first predetermined threshold, and a difference in themeasured signal quality and a signal quality stored in the correspondingentry, is greater than a second predetermined threshold.
 14. Thecomputer program product of claim 12, wherein the instructions cause theprocessor to perform operations comprising: based on determining thatthe cost information has changed, computing whether a change in the costinformation is within a predetermined threshold; and based on computingthat the change in the cost information is within the predeterminedthreshold, updating an entry corresponding to the second network node inthe candidate next hop list with the advertised cost included in thebeacon message.
 15. The computer program product of claim 12, whereinthe instructions cause the processor to perform operations comprising:determining whether the candidate next hop list is full; based ondetermining that the candidate next hop list is full, establishingwhether the advertised cost included in the beacon message is lower byat least a predetermined level compared to a cost included in a bottomentry at an end of the candidate next hop list; and based onestablishing that the advertised cost is lower by at least thepredetermined level compared to the cost included in the bottom entry,replacing information in the bottom entry with information included inthe beacon message, including an identifier of the second network node,the advertised cost and a measure of signal quality.
 16. The computerprogram product of claim 15, wherein the instructions cause theprocessor to perform operations comprising: based on establishing thatthe advertised cost is within the predetermined level compared to thecost included in the bottom entry, determining whether a measure ofsignal quality is included in the bottom entry; based on determiningthat a measure of signal quality is included in the bottom entry,deciding whether the signal quality associated with the beacon messageis better by at least a predetermined level compared to the signalquality included in the bottom entry; and based on deciding that thesignal quality associated with the beacon message is better by at leastthe predetermined level, replacing information in the bottom entry withinformation included in the beacon message, including the identifier ofthe second network node, the hop count, the advertised cost and themeasure of the signal quality.
 17. An apparatus, comprising: one or morenetwork interfaces to communicate with a network; a processor coupled tothe network interfaces and configured to execute one or more processes;and a memory configured to store a process executable by the processor,the process when executed operable to: receive, at a first network node,a beacon message from a second network node, wherein the beacon messageincludes an advertised cost of routing messages to a destination throughthe second network node; determine, based on information included in thebeacon message, whether the second network node is a next hop node ofthe first network node for routing messages to the destination; inresponse to the second network node being a next hop node of the firstnetwork node for routing messages to the destination, select a candidatenext hop list of entries corresponding to the destination; determinewhether the second network node is present in the candidate next hoplist; in response to the second network node not being present in thecandidate next hop list, determine whether the candidate next hop listis empty and if not, whether a timer is active; and in response todetermining that the candidate next hop list is empty and if not, thatthe timer is active, add to an entry in the candidate next hop listinformation from the beacon message.
 18. The apparatus of claim 17,wherein the process when executed further operable to: based onreceiving the beacon message, measure a signal quality associated withthe beacon message; determine whether the signal quality exceeds athreshold; based on determining that the signal quality exceeds athreshold and the second network node is present in the candidate nexthop list, determine whether cost information associated with an entryfor the second network node in the candidate next hop list has changed,wherein the cost information is determined as changed if at least one ofa difference in the advertised cost included in the beacon message and atotal cost stored in the corresponding entry is greater than a firstpredetermined threshold, and a difference in the measured signal qualityand a signal quality stored in the corresponding entry, is greater thana second predetermined threshold.
 19. The apparatus of claim 17, whereinthe process when executed further operable to: based on determining thatthe cost information has changed, compute whether a change in the costinformation is within a predetermined threshold; and based on computingthat the change in the cost information is within the predeterminedthreshold, update an entry corresponding to the second network node inthe candidate next hop list with the advertised cost included in thebeacon message.
 20. The apparatus of claim 17, wherein the process whenexecuted further operable to: determine whether the candidate next hoplist is full; based on determining that the candidate next hop list isfull, establish whether the advertised cost included in the beaconmessage is lower by at least a predetermined level compared to a costincluded in a bottom entry at an end of the candidate next hop list; andbased on establishing that the advertised cost is lower by at least thepredetermined level compared to the cost included in the bottom entry,replace information in the bottom entry with information included in thebeacon message, including an identifier of the second network node, theadvertised cost and a measure of signal quality.